﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EmployeeAdd.ascx.cs" Inherits="PayrollHR.Administration.Modules.EmployeeAdd" %>

<%@ Register Src="~/Administration/Modules/EmployeeInfo.ascx" TagPrefix="uc2" TagName="EmployeeInfo" %>
<asp:UpdatePanel ID="upForumSubscriptions" runat="server">
    <ContentTemplate>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
        <script type="text/javascript">
            $(function () {
                $("[id*=MenuTreeView] input[type=checkbox]").bind("click", function () {
                    var table = $(this).closest("table");
                    if (table.next().length > 0 && table.next()[0].tagName == "DIV") {
                        //Is Parent CheckBox
                        var childDiv = table.next();
                        var isChecked = $(this).is(":checked");
                        $("input[type=checkbox]", childDiv).each(function () {
                            if (isChecked) {
                                $(this).attr("checked", "checked");
                            } else {
                                $(this).removeAttr("checked");
                            }
                        });
                    } else {
                        //Is Child CheckBox
                        var parentDIV = $(this).closest("DIV");
                        if ($("input[type=checkbox]", parentDIV).length == $("input[type=checkbox]:checked", parentDIV).length) {
                            $("input[type=checkbox]", parentDIV.prev()).attr("checked", "checked");
                        } else {
                            $("input[type=checkbox]", parentDIV.prev()).removeAttr("checked");
                        }
                    }
                });
            })
        </script>
        <div class="section-header">
            <div class="title">
                <img src="Common/ico-catalog.png" alt='<%=GetLocaleResourceString("Admin.EmployeeAdd.AddEmployee")%>' />
                <%=GetLocaleResourceString("Admin.EmployeeAdd.AddEmployee")%>
                <asp:Label runat="server" ID="lblTitle" />
                <a href="ListEmployee.aspx" title='<%=GetLocaleResourceString("Admin.EmployeeAdd.AddEmployee")%>'>
                    <%=GetLocaleResourceString("Admin.EmployeeAdd.BackToEmployeeList")%>
                </a>
            </div>
            <div class="options">
                <asp:HyperLink ID="hlexport" runat="server" ForeColor="#6600CC" Visible="False">[hlexport]</asp:HyperLink>

                <asp:Button ID="SaveButton" runat="server" Text="<% $PayrollResources:Admin.CustomerAdd.SaveButton.Text %>"
                    ToolTip="<% $PayrollResources:Admin.CustomerAdd.SaveButton.Tooltip %>" CssClass="adminButtonBlue" OnClientClick="return show()" OnClick="SaveButton_Click" />
                <asp:Button ID="SaveAndStayButton" runat="server" CssClass="adminButtonBlue" Text="<% $PayrollResources:Admin.CustomerAdd.SaveAndStayButton.Text %>" ToolTip="<% $PayrollResources:Admin.CustomerAdd.SaveAndStayButton.Tooltip %>"
                    OnClick="SaveAndStayButton_Click" OnClientClick="return show()" />
            </div>
        </div>
        <ajaxToolkit:TabContainer runat="server" ID="CustomerTabs" ActiveTabIndex="0">
            <ajaxToolkit:TabPanel runat="server" ID="pnlCustomerInfo" HeaderText="<% $PayrollResources:Admin.CustomerAdd.EmployeeInfo %>">
                <ContentTemplate>
                    <asp:Label runat="server" ID="lblEmployeeExists" Text="<%$ PayrollResources:Admin.EmployeeAdd.EmployeeExists %>"
                        Visible="False" Font-Size="X-Large" ForeColor="#FF3300"></asp:Label>
                    <uc2:EmployeeInfo runat="server" ID="ctrlEmployeeInfo" />
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
            <ajaxToolkit:TabPanel runat="server" ID="TabPanel1" HeaderText="Phân quyền">
                <ContentTemplate>
                    <asp:TreeView ID="MenuTreeView" runat="server" ShowCheckBoxes="All" OnClick="OnTreeClick(event)">
                    </asp:TreeView>
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
        </ajaxToolkit:TabContainer>
    </ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="up1" runat="server" AssociatedUpdatePanelID="upForumSubscriptions">
    <ProgressTemplate>
        <div class="progress">
            <asp:Image ID="imgUpdateProgress" runat="server" ImageUrl="~/images/UpdateProgress.gif"
                AlternateText="update" />
            <%=GetLocaleResourceString("Admin.Common.Wait...")%>
        </div>
    </ProgressTemplate>
</asp:UpdateProgress>


